#define _CRT_SECURE_NO_WARNINGS
#include"Sort.h"
void Test_InsertSort()
{
	int a[] = { 5,3,9,7,1,8,2,6,4,10 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	InsertSort(a, size);
	PrintArr(a, size);
}
void Test_ShellSort()
{
	int a[] = { 5,3,9,7,1,8,2,6,4,0 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	ShellSort(a, size);
	PrintArr(a, size);
}

void Test_SelectSort()
{
	int a[] = { 5,3,9,7,1,8,2,6,4,0,10,-1 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	SelectSort(a,0, size-1);
	PrintArr(a, size);
}
void Test_HeapSort()
{
	int a[] = { 5,3,9,7,1,8,2,6,4,0,10,-1,13,20 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	HeapSort(a, size);
	PrintArr(a, size);
}

void Test_BubbleSort()
{
	int a[] = { 5,3,9,7,1,8,2,6,4,0,10,-5,50,9 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	BubbleSort(a, size);
	PrintArr(a, size);
}


void Test_QuickSort()
{
	int a[] = { 5,3,9,7,1,99,2,6,4,0,10,-5,50,9,90,-20 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	QuickSort(a, 0,size-1);
	PrintArr(a, size);
}

void Test_QuickSort2()
{
	int a[] = { 2,3,9,2,1,3,2,5,2,2 ,2,10,20,-10,50,2};
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	QuickSortPart4(a, 0, size - 1);
	PrintArr(a, size);
}


void Test_QuickSortNonR()
{
	int a[] = { 2,3,9,2,1,3,2,5,2,2 ,2,10,20,-10,50,2 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	QuickSortNonR(a, 0, size - 1);
	PrintArr(a, size);
}


void Test_MergeSort()
{
	int a[] = { 2,3,9,2,1,3,2,5,2,2 ,2,10,20,-10,50,2,-20,54,100 };
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	MergeSort(a, 0, size - 1);
	PrintArr(a, size);
}

void Test_MergeSortNonR()
{
	int a[] = { 2,3,9,2,1,3,2,5,2,2 ,2,10,20,-10,50,2,-20,54,100 ,-1,-20,55,33,44};
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	MergeSortNonR(a,size);
	PrintArr(a, size);
}

void Test_CountSort()
{
	int a[] = { 2,3,9,2,1,3,2,5,2,2 ,2,10,20,-10,5,90,6,8,10};
	int size = sizeof(a) / sizeof(int);
	PrintArr(a, size);

	CountSort(a, size);
	PrintArr(a, size);
}
int main()
{
	//Test_InsertSort();
	//Test_ShellSort();
	//Test_SelectSort();
	//Test_HeapSort();
	//Test_BubbleSort();
	//Test_QuickSort();
	//Test_QuickSort2();
	//Test_QuickSortNonR();
	//Test_MergeSort();
	//Test_MergeSortNonR();
	Test_CountSort();
	return 0;
}